/****************************************************
 * 创建人:   robin
 * 创建时间: 2023/9/1.001 10:46
 * 项目名称: cpy
 * 文件名称: PsdpFeign.java
 * 文件描述: 
 *
 * All rights Reserved, Designed By 德品软件
 * @Copyright:2023-2023
 *
 ********************************************************/
package com.dp.feign;

import com.dp.feign.vo.request.AddTradRecord4ReqVO;
import com.dp.feign.vo.request.EditDtuInfoReqVO;
import com.dp.feign.vo.request.EditOilTankReqVO;
import com.dp.feign.vo.request.LoginReqVO;
import com.dp.feign.vo.response.GetDtuInfoByNameRspVO;
import com.dp.feign.vo.response.LoginRspVO;
import com.dp.feign.vo.response.PsdpResponseData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 包名称：com.dp.feign
 * 类名称：PsdpFeign
 * 类描述：Petrol Station Data Platform Feign
 * 创建人：robin
 * 创建时间：2023/9/1.001 10:46
 */
@FeignClient(name = "psdp", url = "${service.psdp.url}", fallbackFactory = PsdpFeignHystrix.class)
public interface PsdpFeign {
    
    @RequestMapping(value = "/sys/mLogin", method = RequestMethod.POST)
    PsdpResponseData<LoginRspVO> login(@RequestBody LoginReqVO loginReqVO);
    
    @RequestMapping(value = "/tank/oilTank/apiedit", method = RequestMethod.PUT, produces="application/json;charset=UTF-8")
    PsdpResponseData editOilTank(@RequestBody EditOilTankReqVO editOilTankReqVO, @RequestHeader(name = "X-Access-Token") String token);
    
    @GetMapping(value = "/dtuInfo/queryByName" , produces="application/json;charset=UTF-8")
    PsdpResponseData<GetDtuInfoByNameRspVO> getDtuInfoByName(@RequestParam(value="name") String name, @RequestHeader(name = "X-Access-Token") String token);
    
    @RequestMapping(value = "/dtuInfo/edit", method = RequestMethod.PUT, produces = "application/json;charset=UTF-8")
    PsdpResponseData editDtuInfo(@RequestBody EditDtuInfoReqVO editDtuInfoReqVO, @RequestHeader(name = "X-Access-Token") String token);
    
    @RequestMapping(value = "/trad/tradRecord/{apiAdd}", method = RequestMethod.POST)
    PsdpResponseData addTradRecord(@PathVariable("apiAdd") String apiAdd,
                                   @RequestBody AddTradRecord4ReqVO addTradRecord4ReqVO,
                                   @RequestParam(value = "threadName") String threadName,
                                   @RequestParam(value = "port") Integer port,
                                   @RequestHeader(name = "X-Access-Token") String token);
    
}
